<ui:composition template="/xhtml/component/template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	xmlns:t="http://myfaces.apache.org/tomahawk">
	<ui:define name="page">
		<h:form prependId="false">

			<t:saveState value="#{recommenderBean}" />
			<p:outputPanel style="width: 97%; text-align: center;">
				<p:tabView>
					<p:tab title="#{msg.label_users}">
						<table align="center" width="100%">
							<tr>
								<td align="center" valign="top">
									<p:outputPanel
										style="width: 99%; text-align: left;">
										<h:panelGrid columns="3">
											<h:outputLabel value="#{msg.label_user_name}:" />
											<h:inputText id="userEmail" maxlength="100" size="40"
												value="#{recommenderBean.userEmail}" />
											<p:commandButton id="btnLoadRecommendation"
												value="#{msg.label_load}" ajax="false"
												action="#{recommenderBean.loadRecommendations}" />
										</h:panelGrid>
									</p:outputPanel>
								</td>
							</tr>
							<tr>
								<td align="center" valign="top">
									<p:dataTable var="user" value="#{recommenderBean.users}"
										style="text-align: center;" paginator="true"
										paginatorPosition="bottom" rows="10">
										<p:column styleClass="user_column">
											<f:facet name="header">
												<h:outputText value="#{msg.label_user_email}" />
											</f:facet>
											<h:outputText value="#{user.email}" />
										</p:column>
										<p:column styleClass="column">
											<f:facet name="header">
												<h:outputText value="#{msg.label_options}" />
											</f:facet>
											<h:commandLink
												action="#{recommenderBean.showUserRecommendations}">
												<h:graphicImage alt="#{msg.label_show_recommendations}"
													title="#{msg.label_show_recommendations}"
													value="/xhtml/image/view_recommendations.png"
													styleClass="icon" />
												<f:setPropertyActionListener value="#{user}"
													target="#{recommenderBean.selectedUser}" />
											</h:commandLink>
										</p:column>
									</p:dataTable>								
								</td>
							</tr>
						</table>
					</p:tab>
				</p:tabView>
				<br />
				<p:commandButton id="btnBack" value="#{msg.label_back}" ajax="false"
					action="#{recommenderBean.backToPrincipal}" />
			</p:outputPanel>
		</h:form>
	</ui:define>
</ui:composition>